#include <stdio.h>
#include <math.h>
#define Arraylen(a) sizeof(a) / sizeof(a[0])

int MyStrLen(char *s)
{
    if (*s == '\0')
        return 0;
    else
        return 1 + MyStrLen(++s);
}

int FastSort(int *a, int start, int end)
{
    int left = start;
    int right = end;
    int temp = a[start];

    while (left < right)
    {
        while (left < right && a[right] > temp)
        {
            right--;
        }
        if (left < right)
        {
            a[left] = a[right];
            left++;
        }
        while (left < right && a[left] < temp)
        {
            left++;
        }
        if (left < right)
        {
            a[right] = a[left];
            right--;
        }
        a[left] = temp;
        FastSort(a, start, left - 1);
        FastSort(a, right + 1, end);
    }
}

void InsertSort(int *a, int len)
{
    for(int i=0;i<len;i++)
    {
        int temp=a[i];

        for(int j=i;j>0;j--)
        {
            
        }
    }
}

int main()
{
    int a[] = {3, 6, 1, 7, 9, 2};
    InsertSort(a, Arraylen(a));
    FastSort(a, 0, Arraylen(a));
    for (int i = 0; i < Arraylen(a); i++)
    {
        printf("%d ", a[i]);
    }
}